package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.ExamMapper;
import com.education.wisdom.pojo.Exam;
import com.education.wisdom.service.IExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考试 服务层实现
 * 
 * @author ruoyi
 * @date 2018-10-31
 */
@Service
public class ExamServiceImpl implements IExamService
{
	@Autowired
	private ExamMapper examMapper;

	/**
     * 查询考试信息
     * 
     * @param examCode 考试ID
     * @return 考试信息
     */
    @Override
	public Exam selectExamById(String examCode)
	{
	    return examMapper.selectExamById(examCode);
	}
	
	/**
     * 查询考试列表
     * 
     * @param exam 考试信息
     * @return 考试集合
     */
	@Override
	public List<Exam> selectExamList(Exam exam)
	{
	    return examMapper.selectExamList(exam);
	}
	
    /**
     * 新增考试
     * 
     * @param exam 考试信息
     * @return 结果
     */
	@Override
	public int insertExam(Exam exam)
	{
	    return examMapper.insertExam(exam);
	}
	
	/**
     * 修改考试
     * 
     * @param exam 考试信息
     * @return 结果
     */
	@Override
	public int updateExam(Exam exam)
	{
	    return examMapper.updateExam(exam);
	}

	/**
     * 删除考试对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteExamByIds(String ids)
	{
		return examMapper.deleteExamByIds(Convert.toStrArray(ids));
	}
	
}
